package com.fengpt.mysqlback.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

@RestController
public class KafkaSender {

    @Autowired
    private KafkaTemplate<String, String> kafkaTemplate;


    //发送消息方法
    @RequestMapping("seed")
    public String send() {

        kafkaTemplate.send("fengpt","777777777777777" );
        return "1";
    }


}
